import dotenv from 'dotenv'
dotenv.config()

function resolveTrueFalse(obj: Record<string, string>) {
  return Object.fromEntries(
    Object.entries(obj).map(([key, value]) => [key, value === 'true' ? true : value === 'false' ? false : value])
  )
}

export const ENV = {
  PORT: 3001,
  ...(resolveTrueFalse(process.env as Record<string, string>) as object),
}
